package com.zhima.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhima.dto.ChangePasswordForm;
import com.zhima.dto.CreateOjUserDTO;
import com.zhima.dto.UserDTO;
import com.zhima.dto.UserDTOExtension;
import com.zhima.entity.OjUser;
import com.zhima.vo.UserCenterBasicInfoVO;
import com.zhima.vo.UserRankVO;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhima
 * @since 2023-08-23
 */
public interface OjUserService extends IService<OjUser> {
    /**
     * 查询用户信息
     * 携带权限相关信息
     *
     * @param userId
     * @return
     */
    UserDTOExtension queryUserDetailWithResources(Long userId);

    /**
     * 通过用户名查
     *
     * @param userName
     * @return
     */
    UserDTOExtension queryUserDetailWithResourcesByUserName(String userName);

    /**
     * 通过手机号查
     *
     * @param phone
     * @return
     */
    UserDTOExtension queryUserDetailWithResourcesByUserPhone(String phone);

    /**
     * 通过邮箱查
     *
     * @param email
     * @return
     */
    UserDTOExtension queryUserDetailWithResourcesByUserEmail(String email);

    /**
     * 创建一个有普通用户角色的账户
     *
     * @param ojUser
     * @return
     */
    UserDTOExtension createPlainUser(CreateOjUserDTO ojUser);

    UserDTO queryUserBasicInfoById(Long userId);

    UserCenterBasicInfoVO getUserCenterInfo(Long userId);

    boolean changeUserName(Long userId, String userName);

    boolean changePhone(Long userId, String phone, String checkCode);

    boolean changeEmail(Long userId, String email, String checkCode);

    boolean changePassword(Long userId, ChangePasswordForm changePasswordForm);

    UserRankVO[] getAcBoard(Long userId, Long pageNum, Long pageSize);
}
